package com.dongdongshop.mapper;

import com.dongdongshop.domain.rep.BrandReq;
import com.dongdongshop.model.Brand;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

public interface BrandMapper {

   /* @Results(id = "BrandMap",value={
            @Result(id=true,column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "first_char",property = "firstChar")
    })*/

    /**
     * 品牌分页查询
     * @param brand
     * @return
     */
    Page<Brand> queryPage(Brand brand);


    /**
     * 品牌增加
     * @param brand
     */
    @Insert("insert into tb_brand values(null,#{name},#{firstChar})")
    void add(Brand brand);


    /**
     * 品牌修改
     * @param brand
     */
    void update(Brand brand);


    /**
     * 品牌删除操作
     * @param id
     * @return
     */
    @Delete("delete from tb_brand where id=#{id}")
    void delete(Long id);

    /**
     * 品牌批量删除操作
     * @param ids
     * @return
     */
    void batchRemove(List<Integer> ids);
}
